#ifndef MODEENCRYPTBASE_H
#define MODEENCRYPTBASE_H

#include <QObject>
#include <QMap>

class ModeEncryptBase : public QObject
{
    Q_OBJECT
public:
    enum E_EncryptModeType
    {
        E_EncryptModeType_1,
        E_EncryptModeType_2,
        E_EncryptModeType_3,
        E_EncryptModeType_End
    };
    enum E_ProgramModeType
    {
        E_ProgramModeType_MAIN, //主模块
        E_ProgramModeType_End
    };
    explicit ModeEncryptBase(ModeEncryptBase::E_ProgramModeType emProgramModeType,QObject *parent = NULL);
    QString encryptLicense(QString strSerialNumber,QString strDate);
private:
    char checkNumber(char);
    char checkCharacterA(char c);
    char checkCharacterH(char c);
    char checkCharacterQ(char c);
    char checkCharacterL(char c);
    char checkCharacterM(char c);
    char checkrandNumber(int n);

    int setCheckNumber(QMap<char,char>& mapCheckNumber);
    int setCheckRandNumber(QMap<int,char>& mapCheckRandNumber);
    int setCheckCharacterAHQLM(QMap<char,int>& mapCheckCharacterAHQLM);
signals:

public slots:
public:
    ModeEncryptBase::E_EncryptModeType emEncryptModeType;
    ModeEncryptBase::E_ProgramModeType emProgramModeType;
protected:
    QMap<char,char> mapCheckNumber;
    QMap<int,char> mapCheckRandNumber;
    QMap<char,int> mapCheckCharacterAHQLM;
};

#endif // MODEENCRYPTBASE_H
